﻿/*
 * ===================================================
 * Author     : <ClueeZhuo>
 * Create Time: <2018/7/20 17:47:09>
 * Description: <This is a Description of This File.>
 * ===================================================
 */



using Microsoft.EntityFrameworkCore;

namespace MyCatTest1.Models
{
    public class SampleContext : DbContext
    {
        public DbSet<Blog> Blogs { get; set; }

        // Add-Migration MySQL_Init
        // Update-Database -Verbose
        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            base.OnConfiguring(optionsBuilder);

            optionsBuilder.UseMyCat(@"server=localhost;port=8066;database=Blog;uid=root;pwd=123456;")
                .UseDataNode(@"localhost", "Blog_1", "test", "test")
                .UseDataNode(@"localhost", "Blog_2", "test", "test")
                .UseDataNode(@"localhost", "Blog_3", "test", "test")
                .UseDataNode(@"localhost", "Blog_4", "test", "test");
        }
    }
}
